<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 引用数据类型
        let flag = true
        console.log(flag);

        let person = new Object();
        person.uname = '张三';
        person.agee = 12;
        // 另一种方法
        let person1 = {
            name: "张三",
            age: 12
        }
        console.log(person);
        console.log(person1);
        // 检测数据类型console.log(typeof 想要检测的)
        console.log(typeof age);
        console.log(typeof agee);
        console.log(typeof name);
        console.log(typeof uname);
        let uuname = '"李四"'
        console.log(uuname);
        // 拼接
        let name1 = '我叫'
        let name2 = '吴彦祖'
        document.write("我叫" + "吴彦祖")
        // 反引号拼接模板字符串
        let name3 = "成"
        let name4 = "宝可梦大师"
        document.write(`我的梦想是${name3}为${name4}`)
        // 案例
        let namee = prompt('请输入姓名:')
        let sex = prompt('请输入性别:')
        let age1 = prompt('请输入年龄:')
        document.write(`大家好，我叫${namee},我是${sex}生，今年${age1}岁了，很高兴认识大家。`)
        let name5 = "成"
        let name6 = "宝可梦大师"
        document.write(`我的梦想是${name5}为${name6}`)
        // 类型转换{隐式转换和显示转换}
        // +两边只要有一个是字符串，另外一个也会转换成字符串(隐式转换)
        console.log(11 + 11);
        console.log('11' + 11);
        console.log('11' - 11);
        console.log(11 - 11);
        console.log(1 * 1);
        console.log('1' * 1);
        console.log(typeof '123');
        console.log(typeof +'123');
        console.log(+'11' + 11);
        let num = +prompt('请输入手机号')
        console.log(typeof num);
        // 显示转换
        // 自己写代码转换
        let str = '111'
        console.log(typeof Number(str));
        console.log(typeof parseFloat(str));
        let str1 = 555
        console.log(typeof String(str1));
        console.log(typeof parseFloat(str1));
        let num1 = +prompt('请输入第一个数字')
        let num2 = +prompt('请输入第二个数字')
        document.write(num1 + num2)


    </script>
</body>

</html>